//
//  WalletDetailController.m
//  WuJieLive
//
//  Created by 张瀚坤 on 2017/11/6.
//  Copyright © 2017年 zhk. All rights reserved.
//

#import "WalletDetailController.h"

@interface WalletDetailController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic , strong) UITableView * tableview;

@property (nonatomic , strong) NSArray * textArray;

@end

@implementation WalletDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

-(void)setNavi
{
    self.title = @"收支详情";
}

- (void)setUI
{
    
    self.tableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 200) style:(UITableViewStylePlain)];
    [self.view addSubview:self.tableview];
    self.tableview.backgroundColor = Color(245, 245, 245);
    self.view.backgroundColor = Color(245, 245, 245);
    
    UIView * headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 65)];
    headerView.backgroundColor = [UIColor whiteColor];
    UIButton * btn = [[UIButton alloc]init];
    [headerView addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(15);
        make.centerY.equalTo(headerView);
        make.size.mas_offset(CGSizeMake(130, 35));
    }];
    [btn setImage:Image(@"icon_充值_大") forState:(UIControlStateNormal)];
    [btn setTitle:@"钱包充值" forState:(UIControlStateNormal)];
    [btn setTitleColor:TextAssistColor forState:(UIControlStateNormal)];
    btn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 15);
    UILabel * label = [[UILabel alloc]init];
    [headerView addSubview:label];
    label.font = FontSize(18);
    label.textColor = TextAssistColor;
    label.text = @"+200";
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-30);
        make.centerY.equalTo(headerView);
    }];
    
    self.tableview.tableHeaderView = headerView;
    self.tableview.dataSource = self;
    self.tableview.delegate = self;
    [self.tableview registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    
    self.tableview.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableview.tableFooterView = [UIView new];
    self.tableview.userInteractionEnabled = NO;
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 20;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    
    cell.textLabel.font = FontSize(13);
    cell.textLabel.textColor = TextLessImportColor;
    cell.textLabel.text = self.textArray[indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
}


-(NSArray *)textArray
{
    if (!_textArray) {
        _textArray = @[@"交易说明：我的钱包充值",@"当前状态：已到账",@"交易单号：CZ_5678645455679",@"交易时间：2017-09-29 16:53:02",@"支付方式：微信支付"];
    }
    return _textArray;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
